import { SelShow } from '../Edit'
import styles from './index.module.scss'

type Props = {
  onClose: () => void
  updateInfo: (type: string, value: number, onClose: () => void) => void
  type: SelShow['type']
}

const genderList = [
  { text: '男', value: 0 },
  { text: '女', value: 1 },
]

const photoList = [
  { text: '拍照', value: 0 },
  { text: '本地选择', value: 1 },
]
const EditList = ({ onClose, updateInfo, type }: Props) => {
  const list = type === 'gender' ? genderList : photoList

  return (
    <div className={styles.root}>
      {list.map((item) => (
        <div
          key={item.text}
          onClick={() => updateInfo(type, item.value, onClose)}
          className="list-item">
          {item.text}
        </div>
      ))}
      {/* <div onClick={() => updateInfo(type, 0)} className="list-item">
        男
      </div>
      <div onClick={() => updateInfo(type, 1)} className="list-item">
        女
      </div> */}
      <div onClick={onClose} className="list-item">
        取消
      </div>
    </div>
  )
}

export default EditList
